package com.example.mobile2021606128wje0506;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class ShowDataActivity extends AppCompatActivity {

    private TextView tvShowDataUserName;
    private TextView tvShowDataPsw;
    private Button btnShowDataChose;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_data);
        initView();
        btnShowDataChose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //取数据

                //第一种
                Intent intent = getIntent();
                tvShowDataUserName.setText(intent.getStringExtra("userName"));

                //第二种
                Bundle bundle = intent.getExtras();
                tvShowDataPsw.setText(bundle.getString("passWord"));

                Intent intent1 = new Intent(ShowDataActivity.this,SupplierActivity.class);
                startActivityForResult(intent,1);

            }
        });




    }

    private void initView() {
        tvShowDataUserName = (TextView) findViewById(R.id.tvShowDataUserName);
        tvShowDataPsw = (TextView) findViewById(R.id.tvShowDataPsw);
        btnShowDataChose = (Button) findViewById(R.id.btnShowDataChose);
    }
}